
<template>
  <div class="logContainer">
    <el-card class="box-card">
      <div slot="header" class="clearfix">
       <i class="el-icon-bell" style="margin-right:10px"></i>
        <span>操作记录</span>
      </div>
      <div class="logArea el-scrollbar">
            <div class="item" v-for="(item,index) in logs" :key="index">
              <div class="logContent">
                <p class="title" style="font-size:14pt">{{item.name}}</p>

                <span class="title time">{{item.create_time}}</span>
                  <p class="title">{{item.action}}</p>
              </div>
          </div>
      </div>
   
  </el-card>
  </div>
</template>

<script>
  import { logs } from '@/api/logs';
  export default {
    name:'logList',
    data() {
      return {
        // github:github
        logs:[]
      };
    },
    mounted(){
      this.getlogs();
    },
    methods:{
        async getlogs(){
            try {
                const lists = await logs();
                if (lists.code == 200) {
                    this.logs=lists.data;
                } else {
                    throw new Error("获取数据失败");
                }
            } catch (err) {
                console.log("获取数据失败", err);
            }
        },
    }
  }
</script>

<style lang="less" scoped>
.logContainer{
    padding: 10px;
    background: #fff;
    box-sizing: border-box;
    height:370px;
    max-height: 370px;
    overflow: hidden;
    border-radius: 6px;
    .logArea{
       overflow: auto;
       height: 100%;
    }
    .item{
       .title{
         font-size: 13px;
       }
       .time{
         color:#87DE75;
       }
        .logContent{
          .logUl{
            padding-left: 30px;
            li{
              font-size: 12px;
              list-style: disc;
              line-height: 20px;
            }
          }
      }
    }
}
  .clearfix:before,
  .clearfix:after {
      display: table;
      content: "";
  }
  
  .clearfix:after {
      clear: both
  }
</style>

